﻿open class Person(protected var name: String) {
    
    // var name1 :String = name 直接提取到构造器中
    
    init {
        println("正在调用主构造器创建Person对象")
    }
    
    var age:Int = 0;
    
    public fun eat(food:String) = println(name+"正在吃"+food)
}